const MyHttpClient = require('./MyHttpClient');

class OmsCase {
    constructor() {
        //this.token = null;
        this.token = "dd86f6889f075ec54789ea0d1295cbaa";
    }

    getClient() {
        return new MyHttpClient("localhost", 10001, "", "baoflyomstkn");
        //return new MyHttpClient("oms.feishou.com", 80, "", "baoflyomstkn", true);
    }

    login() {
        if(this.token != null) {
            return true;
        }
        let obj = {"account": "boflyadm2025", "passwd":"123456"};
        this.getClient().postJson("/login", JSON.stringify(obj), (data) => {
            this.token = data.data;
            //{"code":0,"msg":"login successful","clsName":"UserLoginRes","data":{"token":"cb054fe920efd35655806b3c4986e909"}}
            //-1, "账号不存在"
            //-2, "密码错误"
            //-3, "验证码错误"
            //-4, "账号被禁用"
            console.info('login');
            return true;
        }, (err) => {
            console.error('login, ' + err);
            return false;
        }, null);
    }
    //登出
    logout() {
        this.getClient().getJson("/logout", (data) => {
            console.info('logout, ');
            //{"code":0,"msg":null,"clsName":null,"data":null}
            return true;
        }, (err) => {
            console.error('logout, ' + err);
            return false;
        }, this.token);
    }

    //运营人员-列表
    omsUserLst() {
        if(this.token == null) {
            return;
        }
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/omsuser/list", JSON.stringify(obj), (data) => {
            console.info('omsUserLst, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<OmsUserItemRes>","data":{"recordCount":1,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"userId":1,"account":"xinjueadm2023","userName":"管理员","createTime":1693883822,"updateTime":1693883826,"isDisable":0,"isAdmin":1,"isOms":null,"districtIds":null}]}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('omsUserLst, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-添加账号
    omsUserAdd() {
        if(this.token == null) {
            return;
        }
        let obj = {"account": "jielun", "passwd": "123456", "userName":"周杰伦"};
        this.getClient().postJson("/omsuser/add", JSON.stringify(obj), (data) => {
            console.info('omsUserAdd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('omsUserAdd, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-修改信息
    omsUserUpd() {
        if(this.token == null) {
            return;
        }
        let obj = {"userId": 2, "userName":"周杰伦"};
        this.getClient().postJson("/omsuser/upd", JSON.stringify(obj), (data) => {
            console.info('omsUserUpd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('omsUserUpd, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-修改自己的密码
    omsUserUpdPwd() {
        if(this.token == null) {
            return;
        }
        let obj = {"passwd": "123456", "curPwd": "htwtO0dt5"};
        this.getClient().postJson("/omsuser/updPwd", JSON.stringify(obj), (data) => {
            console.info('omsUserUpdPwd, ');
            //{"code":0,"msg":"修改成功","clsName":null,"data":null}
            //-1, "密码错误"
            return true;
        }, (err) => {
            console.error('omsUserUpdPwd, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-禁用
    omsUserDisable() {
        if(this.token == null) {
            return;
        }
        let obj = {"userId": 2, "isDisable": true};
        this.getClient().postJson("/omsuser/disable", JSON.stringify(obj), (data) => {
            console.info('omsUserDisable, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            //-2, "人员不存在"
            //-3, "不能操作管理员"
            return true;
        }, (err) => {
            console.error('omsUserDisable, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-删除
    omsUserDel() {
        if(this.token == null) {
            return;
        }
        let obj = {"userId": 1};
        this.getClient().postJson("/omsuser/del", JSON.stringify(obj), (data) => {
            console.info('omsUserDel, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            //-2, "不能删除管理员"
            return true;
        }, (err) => {
            console.error('omsUserDel, ' + err);
            return false;
        }, this.token);
    }
    //运营人员-我的信息
    omsUserMyinfo() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/omsuser/myinfo", (data) => {
            console.info('omsUserMyinfo, ');
            //{"code":0,"msg":null,"clsName":"OmsUserItemRes","data":{"userId":1,"account":"xinjueadm2023","userName":"管理员","createTime":1693883822,"updateTime":1693883826,"isDisable":0,"isAdmin":1,"isOms":null,"districtIds":null}}
            return true;
        }, (err) => {
            console.error('omsUserMyinfo, ' + err);
            return false;
        }, this.token);
    }

    //行政区划-一级列表
    dictDistrictFirst() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/dict/district/first", (data) => {
            console.info('dictDistrictFirst, ');
            //{"code":0,"msg":null,"clsName":"List<CatInfo>","data":[{"catId":310000,"catName":"上海","userId":0,"catType":0,"orderNo":null,"catCode":null,"isLeaf":0}]}
            return true;
        }, (err) => {
            console.error('dictDistrictFirst, ' + err);
            return false;
        }, this.token);
    }
    //行政区划-孩子列表
    dictDistrictChild() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/dict/district/child?userId=310000", (data) => {
            console.info('dictDistrictChild, ');
            //{"code":0,"msg":null,"clsName":"List<CatInfo>","data":[{"catId":31011301,"catName":"高境镇","userId":310113,"catType":2,"orderNo":null,"catCode":null,"isLeaf":1},{"catId":31011302,"catName":"淞南镇","userId":310113,"catType":2,"orderNo":null,"catCode":null,"isLeaf":1}]}
            return true;
        }, (err) => {
            console.error('dictDistrictChild, ' + err);
            return false;
        }, this.token);
    }
    //行政区划-祖先(包含自己)列表
    dictDistrictAncestor() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/dict/district/ancestor?catId=31011801", (data) => {
            console.info('dictDistrictAncestor, ');
            //{"code":0,"msg":null,"clsName":"List<CatInfo>","data":[{"catId":310000,"catName":"上海","userId":0,"catType":0,"orderNo":null,"catCode":null,"isLeaf":0},{"catId":310113,"catName":"宝山","userId":310000,"catType":1,"orderNo":null,"catCode":null,"isLeaf":0},{"catId":31011301,"catName":"高境镇","userId":310113,"catType":2,"orderNo":null,"catCode":null,"isLeaf":1}]}
            return true;
        }, (err) => {
            console.error('dictDistrictAncestor, ' + err);
            return false;
        }, this.token);
    }

    //飞手-列表
    userInfoLst() {
        if(this.token == null) {
            return;
        }
        //userId
        //realName
        //isDisable
        //mobile
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/user/info/list", JSON.stringify(obj), (data) => {
            console.info('userInfoLst, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<UserInfoRes>","data":{"recordCount":2,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"userId":2,"openId":"user-test2","mobile":null,"realName":null,"districtId":null,"idNo":null,"idImgs":null,"nationality":null,"headImg":null,"gender":null,"birthday":null,"homeAddr":null,"email":null,"noCriminal":null,"isDisable":0,"createTime":1740709309,"updateTime":1740709312},{"userId":1,"openId":"user-test1","mobile":"13764474169","realName":"郭永超","districtId":110000,"idNo":"4128911","idImgs":"id2.png","nationality":"汉族","headImg":"phtoto.png","gender":1,"birthday":896630400,"homeAddr":"武汉市长江南路2200号","email":"gyc@qq.com","noCriminal":"nocrm.png","isDisable":0,"createTime":1740709270,"updateTime":1740722354}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('userInfoLst, ' + err);
            return false;
        }, this.token);
    }
    //飞手-详情
    userInfoDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/user/info/detail?userId=1", (data) => {
            console.info('userInfoDetail, ');
            //{"code":0,"msg":null,"clsName":"UserInfoRes","data":{"userId":1,"openId":"user-test1","mobile":"13764474169","realName":"郭永超","districtId":110000,"idNo":"4128911","idImgs":"id2.png","nationality":"汉族","headImg":"phtoto.png","gender":1,"birthday":896630400,"homeAddr":"武汉市长江南路2200号","email":"gyc@qq.com","noCriminal":"nocrm.png","isDisable":0,"createTime":1740709270,"updateTime":1740722354}}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('userInfoDetail, ' + err);
            return false;
        }, this.token);
    }
    //飞手-启用禁用
    userInfoDisable() {
        if(this.token == null) {
            return;
        }
        let obj = {"userId":1, "isDisable":0};
        this.getClient().postJson("/user/info/disable", JSON.stringify(obj), (data) => {
            console.info('userInfoDisable, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            //-2, "已经处理"
            return true;
        }, (err) => {
            console.error('userInfoDisable, ' + err);
            return false;
        }, this.token);
    }

    //培训机构-列表
    organInfoLst() {
        if(this.token == null) {
            return;
        }
        //organId
        //companyName
        //districtId
        //isDisable
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/organ/info/list", JSON.stringify(obj), (data) => {
            console.info('organInfoLst, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<OrganInfoRes>","data":{"recordCount":1,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"organId":1,"companyName":"光谷飞讯","companyAddr":"鸭脖路1001号","districtId":110101,"linkMan":"武汉1","linkMobile":"13769538566","organPin":"f244fe0ba230fab7132eaec0ceeb75c6","isDisable":0,"createTime":1740559766,"updateTime":1740559893,"districtAncestors":null}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('organInfoLst, ' + err);
            return false;
        }, this.token);
    }
    //培训机构-详情
    organInfoDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/organ/info/detail?organId=1", (data) => {
            console.info('organInfoDetail, ');
            //{"code":0,"msg":null,"clsName":"OrganInfoRes","data":{"organId":1,"companyName":"光谷飞讯","companyAddr":"鸭脖路1001号","districtId":110101,"linkMan":"武汉1","linkMobile":"13769538566","organPin":"f244fe0ba230fab7132eaec0ceeb75c6","isDisable":0,"createTime":1740559766,"updateTime":1740559893,"districtAncestors":null}}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('organInfoDetail, ' + err);
            return false;
        }, this.token);
    }
    //培训机构-启用禁用
    organInfoDisable() {
        if(this.token == null) {
            return;
        }
        let obj = {"organId":1, "isDisable":1};
        this.getClient().postJson("/organ/info/disable", JSON.stringify(obj), (data) => {
            console.info('organInfoDisable, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('organInfoDisable, ' + err);
            return false;
        }, this.token);
    }
    //培训机构-添加
    organInfoAdd() {
        if(this.token == null) {
            return;
        }
        let obj = {
            "companyName":"光谷飞讯", "companyAddr":"鸭脖路1001号", "districtId":110101, "rebateRatio":10,
            "linkMan":"武汉1", "linkMobile":"13769538566"};
        this.getClient().postJson("/organ/info/add", JSON.stringify(obj), (data) => {
            console.info('organInfoAdd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            return true;
        }, (err) => {
            console.error('organInfoAdd, ' + err);
            return false;
        }, this.token);
    }
    //培训机构-修改
    organInfoUpd() {
        if(this.token == null) {
            return;
        }
        let obj = {"organId":1,
            "companyName":"光谷飞讯", "companyAddr":"鸭脖路1001号", "districtId":110101, "rebateRatio":10,
            "linkMan":"武汉1", "linkMobile":"13769538566"};
        this.getClient().postJson("/organ/info/upd", JSON.stringify(obj), (data) => {
            console.info('organInfoUpd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('organInfoUpd, ' + err);
            return false;
        }, this.token);
    }

    //培训课程-列表
    organCourseLst() {
        if(this.token == null) {
            return;
        }
        //courseId
        //organId
        //courseName
        //companyName
        //districtId
        //isDisable
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/organ/course/list", JSON.stringify(obj), (data) => {
            console.info('organCourseLst, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<OrganCourseRes>","data":{"recordCount":1,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"courseId":1,"organId":1,"courseName":"无人运货","courseFee":50000,"createTime":1740637160,"updateTime":1740637279,"companyName":"光谷飞讯","districtId":110101,"rebateRatio":10,"districtAncestors":null}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('organCourseLst, ' + err);
            return false;
        }, this.token);
    }
    //培训课程-详情
    organCourseDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/organ/course/detail?courseId=1", (data) => {
            console.info('organCourseDetail, ');
            //{"code":0,"msg":null,"clsName":"OrganCourseRes","data":{"courseId":1,"organId":1,"courseName":"无人运货","courseFee":50000,"createTime":1740637160,"updateTime":1740637279,"companyName":"光谷飞讯","districtId":110101,"rebateRatio":10,"districtAncestors":null}}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('organCourseDetail, ' + err);
            return false;
        }, this.token);
    }
    //培训课程-添加
    organCourseAdd() {
        if(this.token == null) {
            return;
        }
        let obj = {"organId":1, "courseName":"无人运货", "courseFee":50000};
        this.getClient().postJson("/organ/course/add", JSON.stringify(obj), (data) => {
            console.info('organCourseAdd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            return true;
        }, (err) => {
            console.error('organCourseAdd, ' + err);
            return false;
        }, this.token);
    }
    //培训课程-修改
    organCourseUpd() {
        if(this.token == null) {
            return;
        }
        let obj = {"courseId":1, "courseName":"无人运货", "courseFee":50000};
        this.getClient().postJson("/organ/course/upd", JSON.stringify(obj), (data) => {
            console.info('organCourseUpd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('organCourseUpd, ' + err);
            return false;
        }, this.token);
    }

    //文章-列表
    articleList() {
        if(this.token == null) {
            return;
        }
        //articleId
        //title
        //onlineStatus 0-下线；1-上线；
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/article/list", JSON.stringify(obj), (data) => {
            console.info('articleList, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<ArticleInfoRes>","data":{"recordCount":1,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"articleId":2,"title":"专场活动成功举办","mainImg":"https://p7.itc.cn/q_70/images01/20210808/2477a79a0cfc42f698da8d89b3420e3b.jpeg","detail":null,"showTime":null,"targetUrl":null,"orderNo":null,"siteType":null,"catType":null,"onlineStatus":1,"omsUserId":1,"createTime":1740641392,"updateTime":1740641415}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('articleList, ' + err);
            return false;
        }, this.token);
    }
    //文章-详情
    articleDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/article/detail?articleId=2", (data) => {
            console.info('articleDetail, ');
            //{"code":0,"msg":null,"clsName":"ArticleInfoRes","data":{"articleId":2,"title":"专场活动成功举办","mainImg":"https://p7.itc.cn/q_70/images01/20210808/2477a79a0cfc42f698da8d89b3420e3b.jpeg","detail":"当苏炳添跑进9秒83，成为人类百米历史上第12快的人、第一个站上决赛跑道的亚洲人，所有人都看到了，这位即将年满32岁的老将代表了一种真正的奥林匹克精神。","showTime":null,"targetUrl":null,"orderNo":null,"siteType":null,"catType":null,"onlineStatus":1,"omsUserId":1,"createTime":1740641392,"updateTime":1740641415}}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('articleDetail, ' + err);
            return false;
        }, this.token);
    }
    //文章-添加
    articleAdd() {
        if(this.token == null) {
            return;
        }
        let obj = {"title":"专场活动成功举办",
            "mainImg":"https://p7.itc.cn/q_70/images01/20210808/2477a79a0cfc42f698da8d89b3420e3b.jpeg",
            "detail":"当苏炳添跑进9秒83，成为人类百米历史上第12快的人、第一个站上决赛跑道的亚洲人，所有人都看到了，这位即将年满32岁的老将代表了一种真正的奥林匹克精神。"};
        this.getClient().postJson("/article/add", JSON.stringify(obj), (data) => {
            console.info('articleAdd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('articleAdd, ' + err);
            return false;
        }, this.token);
    }
    //文章-修改
    articleUpd() {
        if(this.token == null) {
            return;
        }
        let obj = {"articleId":1, "title":"专场活动成功举办",
            "mainImg":"https://p7.itc.cn/q_70/images01/20210808/2477a79a0cfc42f698da8d89b3420e3b.jpeg",
            "detail":"当苏炳添跑进9秒83，成为人类百米历史上第12快的人、第一个站上决赛跑道的亚洲人，所有人都看到了，这位即将年满32岁的老将代表了一种真正的奥林匹克精神。"};
        this.getClient().postJson("/article/upd", JSON.stringify(obj), (data) => {
            console.info('articleUpd, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('articleUpd, ' + err);
            return false;
        }, this.token);
    }
    //文章-上/下线
    articleOnline() {
        if(this.token == null) {
            return;
        }
        //onlineStatus 0-下线；1-上线；
        let obj = {"articleId":2, "onlineStatus":1};
        this.getClient().postJson("/article/online", JSON.stringify(obj), (data) => {
            console.info('articleOnline, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('articleOnline, ' + err);
            return false;
        }, this.token);
    }
    //文章-删除
    articleDel() {
        if(this.token == null) {
            return;
        }
        let obj = {"articleId":1};
        this.getClient().postJson("/article/del", JSON.stringify(obj), (data) => {
            console.info('articleDel, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "操作失败"
            return true;
        }, (err) => {
            console.error('articleDel, ' + err);
            return false;
        }, this.token);
    }

    //订单-列表
    orderInfoList() {
        if(this.token == null) {
            return;
        }
        //orderId
        //orderStatus 订单状态。0-待付款；4-已完成；
        //beginTime     new Date("2022-11-01 00:00:00")
        //endTime       new Date("2022-11-03 23:59:00")
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/order/info/list", JSON.stringify(obj), (data) => {
            console.info('orderInfoList, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<OrderInfoRes>","data":{"recordCount":1,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"orderId":2,"userId":1,"skuId":1,"organId":1,"goodsFee":50000,"deductFee":0,"payableFee":50000,"paymentType":0,"paymentStatus":1,"paymentTime":1740839459,"orderStatus":4,"hasRefund":0,"refundFee":0,"createTime":1740839189,"userName":"郭永超","refundLst":null}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('orderInfoList, ' + err);
            return false;
        }, this.token);
    }
    //订单-详情
    orderInfoDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/order/info/detail?orderId=2", (data) => {
            console.info('orderInfoDetail, ');
            //{"code":0,"msg":null,"clsName":"OrderInfoRes","data":{"orderId":2,"userId":1,"skuId":1,"organId":1,"goodsFee":50000,"deductFee":0,"payableFee":50000,"paymentType":0,"paymentStatus":1,"paymentTime":1740839459,"orderStatus":4,"hasRefund":0,"refundFee":0,"createTime":1740839189,"userName":"郭永超","refundLst":[]}}
            //-1, "订单不存在"
            return true;
        }, (err) => {
            console.error('orderInfoDetail, ' + err);
            return false;
        }, this.token);
    }

    //订单售后-列表
    orderRefundList() {
        if(this.token == null) {
            return;
        }
        //refundId
        //orderId
        //refundStatus 退款状态。0-待审核；3-待打款；4-已完成；5-已驳回；
        //hasError
        //beginTime     new Date("2022-11-01 00:00:00")
        //endTime       new Date("2022-11-03 23:59:00")
        //userId
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/order/refund/list", JSON.stringify(obj), (data) => {
            console.info('orderRefundList, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<OrderRefundRes>","data":{"recordCount":2,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"refundId":3,"orderId":2,"reasonType":0,"refundFee":50000,"refundStatus":4,"hasError":0,"auditRemark":"麻烦了","createTime":1740840445,"userId":1,"skuId":1,"organId":1,"goodsFee":50000,"deductFee":0,"payableFee":50000,"paymentTime":1740839459,"placeTime":1740839189,"userName":"郭永超"},{"refundId":2,"orderId":2,"reasonType":0,"refundFee":50000,"refundStatus":5,"hasError":0,"auditRemark":"质量没问题，客户自己弄坏的","createTime":1740840278,"userId":1,"skuId":1,"organId":1,"goodsFee":50000,"deductFee":0,"payableFee":50000,"paymentTime":1740839459,"placeTime":1740839189,"userName":"郭永超"}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('orderRefundList, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-详情
    orderRefundDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/order/refund/detail?refundId=3", (data) => {
            console.info('orderRefundDetail, ');
            //{"code":0,"msg":null,"clsName":"OrderRefundRes","data":{"refundId":3,"orderId":2,"reasonType":0,"refundFee":50000,"refundStatus":4,"hasError":0,"auditRemark":"麻烦了","createTime":1740840445,"userId":1,"skuId":1,"organId":1,"goodsFee":50000,"deductFee":0,"payableFee":50000,"paymentTime":1740839459,"placeTime":1740839189,"userName":"郭永超"}}
            //-1, "退款单不存在"
            return true;
        }, (err) => {
            console.error('orderRefundDetail, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-添加
    orderRefundAdd() {
        if(this.token == null) {
            return;
        }
        let obj = {"orderId":2, "reasonType":0};
        this.getClient().postJson("/order/refund/add", JSON.stringify(obj), (data) => {
            console.info('orderRefundAdd, ');
            //{"code":0,"msg":null,"clsName":"Long","data":"3"}
            //-1, "订单不存在"
            //-2, "已过售后期"
            //-4, "订单状态不支持退款"
            //-5, "该订单前面退款还没处理完"
            return true;
        }, (err) => {
            console.error('orderRefundAdd, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-审核通过
    orderRefundPass() {
        if(this.token == null) {
            return;
        }
        let obj = {"refundId":3, "refundFee":50000, "auditRemark":"麻烦了"};
        this.getClient().postJson("/order/refund/pass", JSON.stringify(obj), (data) => {
            console.info('orderRefundPass, ');
            //{"code":0,"msg":null,"clsName":null,"data":null}
            //-1, "退款单不存在"
            //-2, "退款单状态错误"
            //-3, "不能比实际费用多"
            return true;
        }, (err) => {
            console.error('orderRefundPass, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-驳回
    orderRefundReject() {
        if(this.token == null) {
            return;
        }
        let obj = {"refundId":2, "auditRemark":"质量没问题，客户自己弄坏的"};
        this.getClient().postJson("/order/refund/reject", JSON.stringify(obj), (data) => {
            console.info('orderRefundReject, ');
            //{"code":0,"msg":null,"clsName":null,"data":null}
            //-1, "退款单不存在"
            //-2, "退款单状态错误"
            return true;
        }, (err) => {
            console.error('orderRefundReject, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-打款
    orderRefundPayment() {
        if(this.token == null) {
            return;
        }
        let obj = {"refundId":3};
        this.getClient().postJson("/order/refund/payment", JSON.stringify(obj), (data) => {
            console.info('orderRefundPayment, ');
            //{"code":0,"msg":null,"clsName":null,"data":null}
            //-1, "退款单不存在"
            //-2, "退款单状态错误"
            //-3, "退款没有发生错误"
            //-21, "post ssl error"
            //-22, "REFUND_FEE_MISMATCH: 订单金额或退款金额与之前请求不一致，请核实后再试"
            //-23, "退款信息不一致"
            return true;
        }, (err) => {
            console.error('orderRefundPayment, ' + err);
            return false;
        }, this.token);
    }
    //订单售后-重新打款(退款发生错误)
    orderRefundFixbug() {
        if(this.token == null) {
            return;
        }
        let obj = {"refundId":1};
        this.getClient().postJson("/order/refund/fixbug", JSON.stringify(obj), (data) => {
            console.info('orderRefundFixbug, ');
            //{"code":0,"msg":null,"clsName":null,"data":null}
            //-1, "退款单不存在"
            //-2, "退款单状态错误"
            //-3, "退款没有发生错误"
            //-21, "post ssl error"
            //-22, "REFUND_FEE_MISMATCH: 订单金额或退款金额与之前请求不一致，请核实后再试"
            //-23, "退款信息不一致"
            return true;
        }, (err) => {
            console.error('orderRefundFixbug, ' + err);
            return false;
        }, this.token);
    }

    //证书-列表
    certificateInfoList() {
        if(this.token == null) {
            return;
        }
        //userId
        //organId
        //auditStatus 审核状态。0-待审核；1-已通过；2-已驳回；
        //curPage 页号，从1开始
        let obj = {"curPage":1, "pageSize":20};
        this.getClient().postJson("/certificate/info/list", JSON.stringify(obj), (data) => {
            console.info('certificateInfoList, ');
            //{"code":0,"msg":null,"clsName":"DataPageRes<UserCertificateRes>","data":{"recordCount":2,"curPage":1,"pageSize":20,"pageNum":1,"itemLst":[{"certificateId":2,"userId":1,"orderId":2,"refundId":5,"courseId":1,"organId":1,"rebateFee":7500,"certificateUrl":"zf.png","auditStatus":1,"auditRemark":"符合要求","createTime":1740903767,"updateTime":1740904500,"userName":"郭永超"},{"certificateId":1,"userId":1,"orderId":2,"refundId":null,"courseId":1,"organId":1,"rebateFee":7500,"certificateUrl":"zf.png","auditStatus":2,"auditRemark":"证书错误","createTime":1740903200,"updateTime":1740903668,"userName":"郭永超"}],"now":null}}
            //-99, "参数错误"
            return true;
        }, (err) => {
            console.error('certificateInfoList, ' + err);
            return false;
        }, this.token);
    }
    //证书-详情
    certificateInfoDetail() {
        if(this.token == null) {
            return;
        }
        this.getClient().getJson("/certificate/info/detail?certificateId=2", (data) => {
            console.info('certificateInfoDetail, ');
            //{"code":0,"msg":null,"clsName":"UserCertificateRes","data":{"certificateId":2,"userId":1,"orderId":2,"refundId":5,"courseId":1,"organId":1,"rebateFee":7500,"certificateUrl":"zf.png","auditStatus":1,"auditRemark":"符合要求","createTime":1740903767,"updateTime":1740904500,"userName":"郭永超"}}
            //-1, "不存在"
            return true;
        }, (err) => {
            console.error('certificateInfoDetail, ' + err);
            return false;
        }, this.token);
    }
    //证书-驳回
    certificateInfoReject() {
        if(this.token == null) {
            return;
        }
        let obj = {"certificateId":1, "auditRemark":"证书错误"};
        this.getClient().postJson("/certificate/info/reject", JSON.stringify(obj), (data) => {
            console.info('certificateInfoReject, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            //-2, "状态错误"
            return true;
        }, (err) => {
            console.error('certificateInfoReject, ' + err);
            return false;
        }, this.token);
    }
    //证书-审核通过
    certificateInfoPass() {
        if(this.token == null) {
            return;
        }
        let obj = {"certificateId":2, "auditRemark":"符合要求"};
        this.getClient().postJson("/certificate/info/pass", JSON.stringify(obj), (data) => {
            console.info('certificateInfoPass, ');
            //{"code":0,"msg":"操作成功","clsName":null,"data":null}
            //-1, "不存在"
            //-2, "状态错误"
            return true;
        }, (err) => {
            console.error('certificateInfoPass, ' + err);
            return false;
        }, this.token);
    }
}
